import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Base64;

public class Main {
    public static void main(String[] args) {
        String encoded= URLEncoder.encode("中文!", StandardCharsets.UTF_8);
        System.out.println(encoded);
        byte[] bytes={'h','e','l','l','o'};
        Base64.Encoder encoder = Base64.getEncoder();
        System.out.println(encoder.encodeToString(bytes));
        Base64.Decoder decoder = Base64.getDecoder();
        System.out.println(new String(decoder.decode("aGVsbG8=")));

    }
}
